<script>
import { useUserStore } from './store/user';

export default {
	
  onLaunch: function() {
    console.log('App Launch');
    // 初始化用户状态
    const userStore = useUserStore();
    userStore.initUserState();
  },
  onShow: function() {
    console.log('App Show');
  },
  onHide: function() {
    console.log('App Hide');
  },
  onLaunch() {
      //清除用户相关存储（每次启动都执行）
      const storageKeys = [
        'userType', 
        'userInfo', 
        'isLoggedIn', 
        'hasShownLoginPopup', 
        'token'
      ];
      
      storageKeys.forEach(key => {
        uni.removeStorageSync(key);
      });
      
      console.log('应用启动，已清除用户存储数据');
    }
};
</script>

<style>
/* 全局样式 */
</style>